<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>实现一个正方形，拖拽窗口，正方形等比例缩放</title>
  <style>
    .box{
      width: 50%;
      padding-bottom: 50%;
      background-color: red;
    }
    .box2{
      width: 50%;
      height: 50vw;
      background-color: blue;
    }
  </style>
</head>
<body>
  <div class="box"></div>
  <div class="box2"></div>
</body>
</html>


<!-- 实现一个正方形，拖拽窗口，正方形等比例缩放 
  http://www.fly63.com/article/detial/7494
-->